﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Model;
using System.Configuration;
using Ext.Net;
namespace TCDC_System.UserControl
{
    public partial class DashboardAdd : System.Web.UI.UserControl
    {
        private tcdc_mst_dashboard obj;

        protected void Page_Load(object sender, EventArgs e)
        {
            obj = new tcdc_mst_dashboard();
            obj.strConn = ConfigurationManager.AppSettings["ConnString"];
        }

        public void Show()
        {
            WindowDashboardAdd.Show();
        }

        protected void SaveDashboard(object sender, DirectEventArgs e)
        {
            obj.description = txt_description.Text;
            obj.parent_id = Convert.ToInt32(txt_parent_id.Text);
            obj.sorting_no = Convert.ToInt32(txt_sorting_no.Text);
            obj.function_id = Convert.ToInt32(txt_function_id.Text);
            obj.icon = txt_icon.Text;
            obj.Link = txt_Link.Text;
            obj.insertData(obj);
            GridStore.DataSource = obj.getByObject(new tcdc_mst_dashboard());
            GridStore.DataBind();
            FormPanel1.Reset();
            WindowDashboardAdd.Hide();
        }
        public Store GridStore { get; set; }
    }
}

